package foliotracker.GUI;

import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Toolkit;

import javax.swing.JFrame;
import javax.swing.JProgressBar;

public class ProgressDialog extends JFrame
{
	private JProgressBar progressBar;
	
	public ProgressDialog()
	{
		super("Updating...");
		super.setLayout(new BorderLayout(6, 6));
		
		progressBar = new JProgressBar(0, 100);
		progressBar.setStringPainted(true);
		progressBar.setSize(240, 30);
		
		super.add(progressBar, BorderLayout.CENTER);
		
		Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
        super.pack();
        super.setLocation((d.width - getWidth()) / 2, (d.height - getHeight()) / 2);
	}
	
	public void update(int percentage)
	{
		progressBar.setValue(percentage);
	}
}
